<?php
require_once('../includes/frameworkajax.php');
if(@!$_GET['term'])
exit;

$term = @$_GET['term'];
$sql = "select cd_forma_pagamento, nr_dias_prazo, nr_percentual_prazo from tethys.tb_prazo_pagamento
where cd_forma_pagamento = {$term}
order by 2 asc
limit 10";
$query = @Connection::query($sql);
$str = '[';
while($row = $query->fetch()){
	$str .= '{"id":"'.$row['ci_item'].'$'.$row['nr_dias_prazo'].'","label":"Prazo'.$row['nr_dias_prazo'].' "},';
}
echo substr($str, 0, -1).']';
?>